﻿using System.Runtime.Serialization;

namespace ClientBackBone.EDDN.Schema1
{
    [DataContract(Name = "commodity", Namespace = "http://schemas.elite-markets.net/eddn/commodity/1#")]
    public class Commodity
    {
        [DataMember(Name = "$schemaRef", IsRequired = true)]
        public string schemaRef = "http://schemas.elite-markets.net/eddn/commodity/1";

        [DataMember(Name = "header", IsRequired = true)]
        public Header header;

        [DataMember(Name = "message", IsRequired = true)]
        public Message message;
    }

    [DataContract(Name = "header", Namespace = "http://schemas.elite-markets.net/eddn/commodity/1#")]
    public class Header
    {
        [DataMember(Name = "uploaderID")]
        public string uploaderID;

        [DataMember(Name = "softwareName")]
        public string softwareName;

        [DataMember(Name = "softwareVersion")]
        public string softwareVersion;

        [DataMember(Name = "gatewayTimestamp")]
        public string gatewayTimestamp;
    }

    [DataContract(Name = "message", Namespace = "http://schemas.elite-markets.net/eddn/commodity/1#")]
    public class Message
    {
        [DataMember(Name = "systemName", IsRequired = true)]
        public string systemName;

        [DataMember(Name = "stationName", IsRequired = true)]
        public string stationName;

        [DataMember(Name = "itemName", IsRequired = true)]
        public string itemName;

        [DataMember(Name = "buyPrice")]
        public int? buyPrice;

        [DataMember(Name = "stationStock", IsRequired = true)]
        public int stationStock;

        [DataMember(Name = "supplyLevel", IsRequired = true)]
        public levelType supplyLevel;

        [DataMember(Name = "sellPrice", IsRequired = true)]
        public string sellPrice;

        [DataMember(Name = "demand", IsRequired = true)]
        public int demand;

        [DataMember(Name = "demandLevel")]
        public string demandLevel;

        [DataMember(Name = "timestamp", IsRequired = true)]
        public string timestamp;
    }

    [DataContract(Name = "levelType")]
    public enum levelType
    {
        [EnumMember(Value = "Low")]
        Low,

        [EnumMember(Value = "Med")]
        Med,

        [EnumMember(Value = "High")]
        High
    }
}